<template>
	<view class="page-body">
		<text>支付中..</text>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		data() {
			return {
				timeStamp: "",
				nonceStr: "",
				prepay_id: "",
				paySign: ""
			}
		},
		computed: {
		},
		onLoad: function(options) {
			wx.requestPayment({
				nonceStr: options.nonceStr,
				package: "prepay_id=" + options.prepay_id,
				paySign: options.paySign + "==",
				timeStamp: options.timeStamp,
				signType: "RSA",
				"success": (res) => {
					uni.showToast({
						icon: 'success',
						title: '支付成功'
					});
					
					setTimeout(() => {
						uni.navigateBack({
							delta: 2
						});
					}, 1000)
				},
				"fail": (res) => {
					uni.showToast({
						icon: 'error',
						title: '支付失败'
					})
					setTimeout(() => {
						uni.navigateBack({
							delta: delta
						})
					}, 1000)

				}
			})
		},
		methods: {

		}
	}
</script>

<style>

</style>
